{% extends 'layout/main.html' %}

{% block main %}
  <div id="main" class="main-container container">


    <div class="row">
  <div class="col-md-6 col-md-offset-3">
    <div class="panel panel-default">
      <div class="panel-heading">注册新用户</div>
      <div class="panel-body">
        <form class="simple_form " novalidate="novalidate" id="new_user" action="/register" accept-charset="UTF-8" method="post">
          {{ xsrf_form_html() }}

          {% if errors %}
            <div class="alert alert-block alert-danger">
              <a href="#" data-dismiss="alert" class="close">×</a>
              <p><strong>有 N 处问题导致无法提交:</strong></p>
              {% for key,value in errors.items() %}
                  {% for error in value %}
                      <ul><li>{{ error }}</li></ul>
                  {% endfor %}
              {% endfor %}
            </div>
          {% endif %}

        <div class="form-group">
          <input type="email" class="form-control" autocomplete="off" placeholder="用户名" hint="谨慎填写，以后不可修改，建议用 Twitter ID。" name="user_login" id="user_login" />
        </div>
        <div class="form-group">
          <input class="form-control" autocomplete="off" placeholder="名字" type="text" name="username" id="user_name" />
        </div>
        <div class="form-group">
          <input type="email" autocomplete="off" class="form-control" placeholder="Email" value="" name="email" id="user_email" />
        </div>
        <div class="form-group">
          <div class="checkbox">
            <label for="user_email_public" class="checkbox">
              <input name="user_email_public" type="hidden" value="0" />
              <input type="checkbox" value="1" checked="checked" name="email_public" id="user_email_public" /> 公开 Email
            </label>
          </div>
        </div>
        <div class="form-group">
        <input class="form-control" placeholder="密码" type="password" name="password" id="user_password" />
        </div>
        <div class="form-group">
        <input class="form-control" placeholder="确认密码" type="password" name="password_confirmation" id="user_password_confirmation" />
        </div>
        <div class="form-group">
          <input class="form-control" placeholder="验证码" name="_rucaptcha" type="text" autocorrect="off" autocapitalize="off" pattern="[0-9a-z]*" maxlength="4" autocomplete="off" />
        </div>
        <div class="form-group">
          <a class="rucaptcha-image-box" href="#">
            <img class="rucaptcha-image" src="https://ruby-china.org/rucaptcha/" alt="Rucaptcha" />
          </a>
        </div>
        <div class="form-group">
          <input type="submit" name="commit" value="提交注册信息" class="btn btn-primary" data-disable-with="正在提交" />
          / <a class="btn btn-default" href="/login">登录</a>
        </div>
</form>      </div>
    </div>
  </div>
</div>

  </div>


{% endblock %}